Skip to content

[Custom Page Sizes] Feature/support custom pages size #7694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BilelGho
Copy link

@BilelGho BilelGho commented Jul 1, 2025

This implements the feature across the toolchain by adding the page size as an attribute of the memory instead of a constant.

I added the tests from the proposal repo to spec/test (not sure if it was the right move)

implements #6873

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments. General direction looks good.

@BilelGho
Copy link
Author

BilelGho commented Jul 2, 2025

Sorry, when I pushed this I wasn't aware of the trsting structure and didn't pay attention how to run it. I am currently working on making all the tests run and will push changes once done.

@BilelGho BilelGho force-pushed the feature/support-custom-pages-size branch 2 times, most recently from 92baf35 to 89ae10f Compare July 7, 2025 15:18
@BilelGho BilelGho marked this pull request as draft July 7, 2025 16:31
@BilelGho BilelGho force-pushed the feature/support-custom-pages-size branch 15 times, most recently from 0a17137 to 04bee60 Compare July 8, 2025 12:58
@BilelGho BilelGho force-pushed the feature/support-custom-pages-size branch from 04bee60 to 47f0b6d Compare July 8, 2025 13:15
@BilelGho BilelGho marked this pull request as ready for review July 8, 2025 13:50
@BilelGho
Copy link
Author

BilelGho commented Jul 8, 2025

Tests working now. Most of the edits are straightforward and are about extending the core Memory interface to include a memory page size, stored as a log2 and updating the parser, validator, binary reader/writer, interpreter, the wasm2js glue, and related passes.

Most of the changes in the passes involved supporting a variable page size, whose size is provided and stored as a log2. The pass that involved some change in the logic is the multi-memory lowering. The combined memory would have the minimum page size of the memories to be unified. memory.grow and memory.size implementations are adapted accordingly. The secondary memory created in instrumenter.cpp still uses the default page size.

Tests from the proposal are added. However, due to lacking linking verification at instantiation in the interpreter, some tests with invalid modules that were expected to failed did not and therefore are skipped in the configuration.

@BilelGho BilelGho requested a review from kripken July 9, 2025 06:38
@BilelGho BilelGho changed the title Feature/support custom pages size [Custom Page Sizes] Feature/support custom pages size Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants